cmake_minimum_required(VERSION 3.12) # 确保使用的CMake版本支持HIP

# 设置项目名称和版本
project(VectorAddHip VERSION 1.0 LANGUAGES CXX)

# 查找HIP包
find_package(HIP REQUIRED)

# 检查是否找到HIP
if(NOT HIP_FOUND)
    message(FATAL_ERROR "HIP is required but not found.")
endif()

# 设置C++编译器为hipcc
set(CMAKE_CXX_COMPILER hipcc)

# 添加文件
set(SRC_FILES
    src/tensor.cpp
    src/math_ops.cpp
    #demo/main.cpp
)
include_directories(
    include
)

# 添加可执行文件
add_library(tensor_library STATIC
    ${SRC_FILES}
)

add_subdirectory(demo)
add_subdirectory(test)